module AboutYou
  module SDK
    module Model
      ###
      # This Class represents an app model
      ###
      class App
        # the id of the app
        attr_accessor :id
        # the logo url of the app
        attr_accessor :logo_url
        # the name of the app
        attr_accessor :name
        # the url of the app
        attr_accessor :url
        # the privacy statement url
        attr_accessor :privacy_statement_url
        # the tearms of service url
        attr_accessor :tos_url

        ###
        # This method is used for creating an instance of this class by a json_object.
        #
        # * *Args*    :
        #   - +json+ -> the json_object received from the api
        #
        # * *Returns* :
        #   - Instance of AboutYou::SDK::Model::App
        ###
        def self.create_from_json(json)
          app = new

          app.id                    = json['id']
          app.logo_url              = json['logo_url']
          app.name                  = json['name']
          app.url                   = json['url']
          app.privacy_statement_url = json['privacy_statement_url']
          app.tos_url               = json['tos_url']

          app
        end
      end
    end
  end
end
